﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration.Conventions;
using System.Data;
using FCTC_Web.Models;
using System.Web.Security;
using System.ComponentModel.DataAnnotations;

namespace FCTC_Web.DAL
{
    public class FCTC_DataContext : DbContext
    {
        public FCTC_DataContext()
        {
           //Database.SetInitializer<FCTC_DataContext>(null);
           Database.SetInitializer<FCTC_DataContext>(new DropCreateDatabaseIfModelChanges<FCTC_DataContext>());

            this.Configuration.ValidateOnSaveEnabled = false;
        }

        public DbSet<Estimator> Estimators { get; set; }
        public DbSet<Vehicle> Vehicles { get; set; }
        public DbSet<Clip> Clips { get; set; }
        public DbSet<ImageModel> Images { get; set; }
        public DbSet<Case> Cases { get; set; }
        public DbSet<Shop> Shops { get; set; }
        public DbSet<Personal> Personals { get; set; }
        public DbSet<VehicleEstimation> VehicleEstimations { get; set; }
        public DbSet<Article> Articles { get; set; }
        public DbSet<Team> Teams { get; set; }
        public DbSet<TeamMember> TeamMembers { get; set; }
        public DbSet<SessionArrangement> SessionArrangements { get; set; }
        public DbSet<SessionUnit> SessionUnits { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {

            modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
        }
    }


}